package com.bkgy.controller.zincpot.controller;

import com.bkgy.commom.model.QueryDTO;
import com.bkgy.controller.zincpot.dto.ZincPotHisPageDTO;
import com.bkgy.controller.zincpot.entity.ZincPidHisEntity;
import com.bkgy.controller.zincpot.entity.ZincPotEntity;
import com.bkgy.controller.zincpot.service.ZincPotService;
import com.bkgy.controller.zincpot.vo.ZincPotHisPageVO;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/zincPot")
public class ZincPotController {

    @Autowired
    private ZincPotService zincPotService;

    @Operation(summary = "P8计算值", description = "P8计算值")
    @PostMapping("/getP8Calc")
    public List<ZincPotEntity> getP8Calc() {
        return zincPotService.getP8Calc();
    }

    @Operation(summary = "风机速度", description = "风机速度")
    @PostMapping("/getWindTurbine")
    public List<ZincPidHisEntity> getWindTurbine() {
        return zincPotService.getWindTurbine();
    }

    @Operation(summary = "分页查询数据", description = "分页查询数据")
    @PostMapping("/pageZincPotHis")
    public ResultData<List<ZincPotHisPageVO>> getZincPotHisPage(@RequestBody @Validated QueryDTO<ZincPotHisPageDTO> queryDTO) {
        return zincPotService.getZincPotHisPage(queryDTO);
    }

    @Operation(summary = "导出ZincPotHis的excel", description = "导出ZincPotHis的excel")
    @PostMapping("/exportExcel")
    public void exportExcel(@RequestBody @Validated ZincPotHisPageDTO queryDTO) {
        zincPotService.exportExcel(queryDTO);
    }
}
